package lschgcdev.apis;

import java.util.Date;

public class Logger {
	private final int 
		notice = 2,
		warning = 0,
		debug = 9,
		error = 8;
	
	UIDentificable infoLog;
	
	public <T> Logger(UIDentificable classToLog){
		infoLog = classToLog;
	}
	
	@SuppressWarnings("deprecation")
	private String infoClass(){
		return "["+(new Date().toLocaleString())+"] <"+infoLog.getUID()+"> - ";
	}
	
	public void print(String source, Object msg){
		source = infoClass()+source;
		System.out.println(source+msg);
	}
	
	public void print(int level, Object msg){
		String infoSource = "";
		switch(2){
		case notice:
			infoSource += "[Notice]: ";
			break;
		case warning:
			infoSource += "[Warning]: ";
			break;
		case debug:
			infoSource += "[Debug]: ";
			break;
		case error:
			infoSource += "[Error]: ";
			break;
		}
		
		print(infoSource, msg);
	}
	
	public void notice(Object msg){
		print(notice, msg);
	}
	public void warning(Object msg){
		print(warning, msg);
	}
	public void debug(Object msg){
		print(debug, msg);
	}
	public void error(Object msg){
		print(error, msg);
	}
	
}
